<template>
	<div class="app-vchart-pie">
		<!--线图 -->
			
			<ve-line 
				:data="chartData"
        :extend="extend"
				:settings="chartSettings"
        >
				<div v-show="!chartData||!chartData.rows||!chartData.rows.length" class="v-charts-data-empty">
					<span style="line-height: 1;">
						<!--<i class="iconfont icon-no-chart"></i>
						<br />-->
						 暂无数据 
					</span>
				</div>
			</ve-line>

	</div>
</template>

<script>
	import VeLine from 'v-charts/lib/line.common'
	
	let dw = "" // 单位
	export default {
		components : {
			VeLine,
		},
		props: [
			"options",
		],
		data() {
			this.chartSettings = {
        // area: true
      }
			return {
				chartData: {},
				extend: {
						grid : {
							left : "0",
							right : "20"
						},
						colors : ['#67C23A', '#E6A23C', '#F56C6C', '#409EFF'],
					  xAxis: {
			        type: 'time'
			        // splitLine:{show: true}
			      },
			      yAxis: {
			        axisLabel: {
			          formatter: function(val,a,b,c) {
			            return val + dw
			          }
			        }
			      },
			      series: {
							  type:'line',
								smooth:true,
								symbol: "none",
						}
					
				},

				title: {
					text: '',
					textStyle: {
						fontSize: 14,
					},
					padding: 2
				},
				
				loading : true ,
			}
		},
		mounted(){

		},
		methods: {
			init(data){
				this.loading = false ;
				dw = data.dw;
				this.chartData = data ;
			},
			refresh(){
				this.init();
			}
		}

	}
</script>